<template>
    <div>
        <div v-if='payStatus'>恭喜您支付成功~</div>
        <div v-else>支付失败</div>
    </div>
</template>

<script>
import { successPayment } from '@/common/api/index.js'
import qs from 'qs'
export default {
    data () {
        return {
            payStatus: false
        }
    },
    created () {
        this.getData();
    },
    methods: {
        getData () {
            let datas = {
                out_trade_no: this.$route.query.out_trade_no,
                trade_no: this.$route.query.trade_no
            }
            successPayment(qs.stringify(datas)).then(res => {
                if (res.code == 2) {
                    this.payStatus = true;
                }
            })
        }
    }
}
</script>

<style>
</style>
